import Vue from 'vue'
import VueRouter from 'vue-router'
import UserView from '../views/UserView.vue'
import MainView from '../views/MainView.vue'
import MyWalletView from '../views/MyWalletView.vue'
import RecordView from '../views/RecordView.vue'
import DetailView from '../views/DetailView.vue'
import PurchaseView from '../views/PurchaseView.vue'
import AssetView from '../views/AssetView.vue'
import RechargeView from '../views/RechargeView.vue'
import UserMeasurementView from '../views/UserMeasurementView.vue'
import RateAdjustmentView from '../views/RateAdjustmentView.vue'
import ConfirmFundSequenceView from '../views/ConfirmFundSequenceView.vue'
import LoginView from '../views/LoginView.vue'
import BuyView from '../views/BuyView.vue'
import SellView from '../views/SellView.vue'
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect:'/login',
  },
  {
    path: '/user',
    name: 'user',
    component: UserView,
    redirect:'/user/main',
    children:[
      { path: '',
        redirect:'main'
      },
      {
        path:'main',
        name:'MainView',
        component:MainView,
      },
      {
        path: 'mywallet',
        name:'MyWalletView',
        component:MyWalletView,
      },
    
      {
        path: 'record',
        name:'RecordView',
        component:RecordView
      },
      {
        path: 'detail',
        name:'DetailView',
        component:DetailView
      },
      {
        path: 'purchase',
        name:'PurchaseView',
        component:PurchaseView
      },
      {
        path: 'asset',
        name:'AssetView',
        component:AssetView
      },  
      {
        path: 'recharge',
        name:'RechargeView',
        component:RechargeView
      },
      {
        path:'usermeasurement',
        name:'UserMeasurementView',
        component:UserMeasurementView
      },
      {
        path:'rateadjustment',
        name:'RateAdjustmentView',
        component:RateAdjustmentView
      },
      {
        path:'confirmfundsequence',
        name:'ConfirmFundSequenceView',
        component:ConfirmFundSequenceView
      },
      {
        path:'buy',
        name:'BuyView',
        component:BuyView
      },
      {
        path:'sell',
        name:'SellView',
        component:SellView
      }
  ]
  },
  {
    path:'/login',
    component:LoginView
  }
 
]

const router = new VueRouter({
  routes
})

export default router
